﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Activities;

namespace WFBot.Workflow.Activities
{
    public class PushMessage : NativeActivity
    {
        public InArgument<string> Channel { get; set; }
        public InArgument<string> Message { get; set; }

        protected override void Execute(NativeActivityContext context)
        {
            var wfService = context.GetExtension<IWorkflowService>();
            wfService.Push(new Message
            {
                Channel = Channel.Get(context),
                Sender = "WFBot",
                Type = MessageType.TextMessage,
                Body = Message.Get(context),
                Origin = MessageOrigin.Server,
            });
        }
    }
}